import dayjs from 'dayjs'
import * as relativeTime from 'dayjs/plugin/relativeTime' // use locale

import 'dayjs/locale/zh-cn' // import plugin
dayjs.extend(relativeTime) // use plugin
dayjs.locale('zh-cn') // import locale

export const timeTo = (dateStr) => dayjs().to(dayjs(dateStr))
